package com.huanghwh.sync.core.config;

import cn.hutool.db.ds.DSFactory;
import cn.hutool.db.ds.druid.DruidDSFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @Author: huanghwh
 * @Date: 2021/12/21 15:39
 * @Description:
 */
@Component
@Slf4j
public class DbPoolInit implements ApplicationRunner {


    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("加载Druid连接池");
        DSFactory.setCurrentDSFactory(new DruidDSFactory());
    }
}
